package transaction;

import model.SimpleUser;
import persistance.UserDAO;

public class UserService {

	private LogDAO logdao;
	public LogDAO getLogdao() {
		return logdao;
	}

	public void setLogdao(LogDAO logdao) {
		this.logdao = logdao;
	}

	public UserDAO getUserdao() {
		return userdao;
	}

	public void setUserdao(UserDAO userdao) {
		this.userdao = userdao;
	}

	private UserDAO userdao;
	
	public void addUserService()
	{
		SimpleUser user=new SimpleUser("lcx-trans",25);
		userdao.insert(user);
		logdao.log();
	}
	
	public void addUserServiceException() throws Exception
	{
		SimpleUser user=new SimpleUser("lcx-exception333",25);
		userdao.insert(user);
		logdao.logException();
	}
	
}
